package org.shj.thread.book2.chapter10;

//Two-phase terminate
public class Main {

	public static void main(String[] args){
		System.out.println("main: Begin");
		try{
			CountupThread t = new CountupThread();
			t.start();
			
			Thread.sleep(10000);
			
			System.out.println("Main: shutdownRequest");
			t.shutdownRequest();
			
			System.out.println("Main: join");
			t.join(); //等待线程结束
		}catch(InterruptedException e){
			e.printStackTrace();
		}
		System.out.println("Main: END");
	}
}
